-- GENERATED SPELL FOR [Mag'har Watcher] --


function spell0_16911(pUnit, Event) --@Fire Nova Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32062,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_16911', 1, 1)
end

function spell1_16911(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(11986,pUnit)
pUnit:RegisterEvent('Sorts_16911', 3000, 1)
end

function spell2_16911(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(12550,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16911', 0, 1)
end

function Sorts_16911(pUnit, Event)
local choix_sorts_16911 = math.random(0, 2)
if choix_sorts_16911 == 0 then
pUnit:RegisterEvent('spell0_16911', 1, 1)
end
if choix_sorts_16911 == 1 then
pUnit:RegisterEvent('spell1_16911', 1, 1)
end
if choix_sorts_16911 == 2 then
pUnit:RegisterEvent('spell2_16911', 1, 1)
end
end

function mob16911_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16911', math.random(1500, 3000), 1)
end

function mob16911_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16911_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16911_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16911, 1, 'mob16911_Action')
RegisterUnitEvent(16911, 2, 'mob16911_Leave')
RegisterUnitEvent(16911, 3, 'mob16911_Kill')
RegisterUnitEvent(16911, 4, 'mob16911_Die')
